jQuery(document)
		.ready(
				function($) {
					// code
					$
							.contextMenu({
								selector : '.context-menu-one',
								callback : function(key, options) {

									var m = "clicked: " + key;

									var id = options.$trigger.attr("id");
									$
											.ajax({
												// The link we are accessing.
												url : "http://localhost/dev_an/shopping/trunk/CodeIgniter_2.1.3/products/action_by_id",

												// The type of request.
												type : "post",
												data : {
													action : key,
													id : id
												},

												error : function(e) {
													// called when there is an
													// error
													console.log(e.message);
												},

												success : function(strData) {

													$("#backend_content").html(
															strData);

												}
											});

									// /

								},
								items : {
									"edit" : {
										name : "Edit",
										icon : "edit"
									},
									"cut" : {
										name : "Cut",
										icon : "cut"
									},
									"copy" : {
										name : "Copy",
										icon : "copy"
									},
									"paste" : {
										name : "Paste",
										icon : "paste"
									},
									"delete" : {
										name : "Delete",
										icon : "delete"
									},
									"sep1" : "---------",
									"quit" : {
										name : "Quit",
										icon : "quit"
									}
								}
							});

					$(".category")
							.click(
									function() {
										var id = 0;
										id = this.id;
										// alert(id);
										$
												.ajax({
													// The link we are
													// accessing.
													url : "http://localhost/dev_an/shopping/trunk/CodeIgniter_2.1.3/products/get_by_category_id",

													// The type of request.
													type : "post",
													data : 'category_id=' + id,

													error : function(e) {
														// called when there is
														// an error
														console.log(e.message);
													},

													success : function(strData) {

														$("#content").html(
																strData);

													}
												});
									});

					
				
					   $("#add_product").click(function(e){
						   var  action=this.name;
					       e.preventDefault();
					  
					       var   dataString = $("#JqAjaxForm").serialize();
					       $("#message_ajax").html('.....................');
					        $.ajax({
					        type: "POST",
					        url: "http://localhost/dev_an/shopping/trunk/CodeIgniter_2.1.3/products/action_add_product",
					        data: dataString,
					     
					        error : function(e) {
								// called when there is
								// an error
								
								alert(e.message);
							},

					        success: function(data) {
					         
					            
					                $("#message_ajax").html(data);
					           
					          
					        }
					           
					        });         
					         
					    });
				
					   

				});